package com.lgl.cli.example;


import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
import picocli.CommandLine.Parameters;


/**
 * @author 良哥
 * @verison 1.0
 */

/**
 * @author 良哥
 * @verison 1.0
 */


@Command(name = "ASCIIArt", version = "ASCIIArt 1.0", mixinStandardHelpOptions = true)
public class ASCIIArt implements Runnable {
    private static final ASCIIArt asciiArt = new ASCIIArt();

    public ASCIIArt() {
    }

    public static ASCIIArt getAsciiArt() {
        if (asciiArt == null) return new ASCIIArt();
        return asciiArt;
    }

    @Option(names = {"--s", " --font-size"}, description = "Font-size")
    int fontSize = 19;

    @Parameters(paramLabel = "<word>", defaultValue = "Hello, picocli", description = "Words to be translated into ASCII art.")
    private String[] words = {"Hello,", "picocli"};

    @Override
    public void run() {
        // 自己实现业务逻辑
        System.out.println("fontSize = " + fontSize);
        System.out.println("words = " + String.join(",", words));
    }

    public static void main(String[] args) {
        int exitCode = new CommandLine(new ASCIIArt()).execute(args);
        System.out.println(exitCode);
        System.exit(exitCode);
    }
}
